"""audio_book URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import re_path
from listen_book import views
from book_manage import views as book_views
from book_admin import views as admin_views
from django.views.generic.base import TemplateView


urlpatterns = [
    # 后台管理系统打包发布
    path('', TemplateView.as_view(template_name='index.html')),
    # 客户端入口
    path('client/', views.home_page),
    # django 提供的内置应用
    path('admin/', admin.site.urls),
    # Client-user
    path('login/', views.Login.as_view()),  # 登录 json post
    path('register/', views.Register.as_view()),  # 注册  验证码获取
    path('user/getUserInfo/', views.GetUserInfo.as_view()),  # 获取用户信息 json
    path('logout/', views.Logout.as_view()),
    path('user/modifyUserInfo/', views.ModifyUserINfo.as_view()),  # 修改用户信息 json
    path('user/uploadImg/', views.Upload.as_view()),
    path('user/signIn/', views.Sign.as_view()),  # 签到
    path('wallet/chargeCoin/', views.ChargeCoin.as_view()),  # 充值书币
    path('user/collect/', views.Collect.as_view()),  # 收藏
    path('user/shelf/', views.BookShelf.as_view()),  # 书架
    path('user/Comment/', views.UserComment.as_view()),  # 评论点赞
    path('user/BuyBook/', views.BuyBook.as_view()),  # 购买 get post
    # Client-book_manage
    path('book/getTypeBook/', book_views.GetBook.as_view()),  # 获取分类书籍  参数：type
    path('book/getRank/', book_views.GetRank.as_view()),  # 获取排行  参数 type state
    path('book/getRecommend/', book_views.GetRecommend.as_view()),  # 获取首页数据
    path('book/getBookDetiles/', book_views.GetBookDetiles.as_view()),  # 获取书详情
    path('book/search/', book_views.SearchBook.as_view()),  # 搜索
    # Backstage
    path('admins/login/', admin_views.AdminLogin.as_view()),  # admin login
    path('admins/getRouter/', admin_views.GetRouter.as_view()),  # admin login
    path('admins/getHomeMessage/', admin_views.HomeMessage.as_view()),  # 获取chart
    path('admins/adminManage/', admin_views.AdminManage.as_view()),  # Admin管理
    path('admins/userManage/', admin_views.UserManage.as_view()),  # 用户管理
    path('admins/vipManage/', admin_views.VipManage.as_view()),  # Vip管理
    path('admins/bookManage/', admin_views.BookManage.as_view()),  # Book管理
    path('admins/commentManage/', admin_views.CommentManage.as_view()),  # Comment管理
    path('admins/swiperManage/', admin_views.SwiperManage.as_view()),  # Comment管理
    path('websocketLink/', admin_views.websocketLink)  # webSocket 消息广播

]
